{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "source": [
    "import numpy as np\n",
    "from sklearn.decomposition import PCA\n",
    "from argparse import Namespace\n",
    "import os, sys\n",
    "\n",
    "sys.path.insert(0, os.path.join(os.getcwd(), '..'))"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "source": [
    "from src.utils import read_txt_embeddings\n",
    "from src.evaluation.word_translation import load_dictionary"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "source": [],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "source": [
    "params = Namespace(\n",
    "    src_lang = 'en',\n",
    "    tgt_lang = 'zh',\n",
    "    src_emb = '../data/wiki.en.vec',\n",
    "    tgt_emb = '../data/wiki.zh.vec',\n",
    "    emb_dim = 300,\n",
    "    max_vocab = 20000,\n",
    "    cuda = False,\n",
    ")\n",
    "\n",
    "src_dico, src_vec = read_txt_embeddings(params, True, False)\n",
    "tgt_dico, tgt_vec = read_txt_embeddings(params, False, False)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "source": [
    "trans_dico = load_dictionary('../data/crosslingual/dictionaries/en-zh.0-5000.txt', src_dico.word2id, tgt_dico.word2id)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "source": [
    "src_slivec = src_vec[100:110]"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [],
   "outputs": [],
   "metadata": {}
  }
 ],
 "metadata": {
  "orig_nbformat": 4,
  "language_info": {
   "name": "python",
   "version": "3.9.5",
   "mimetype": "text/x-python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "pygments_lexer": "ipython3",
   "nbconvert_exporter": "python",
   "file_extension": ".py"
  },
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.9.5 64-bit ('base': conda)"
  },
  "interpreter": {
   "hash": "89ed7adc654ab155dcc9ba65387c745930b163e7b2d9e526471843411ef9ebae"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}